#define _CRT_SECURE_NO_WARNINGS 1
#include"SeqList.h"

void test1()
{
	SeqList st;
	SeqListInit(&st);
	SeqListPushBack(&st, 1);
	SeqListPushBack(&st, 2);
	SeqListPushBack(&st, 3);
	SeqListPushBack(&st, 4);
	SeqListPrint(&st);
	//1 2 3 4 

	SeqListPushFront(&st, 5);
	SeqListPushFront(&st, 6);
	SeqListPushFront(&st, 7);
	SeqListPushFront(&st, 8);
	SeqListPushFront(&st, 9);
	SeqListPrint(&st);
	// 9 8 7 6 5 1 2 3 4 

	SeqListPopBack(&st);
	SeqListPopBack(&st);
	SeqListPopBack(&st);
	SeqListPopBack(&st);
	SeqListPrint(&st);
	//9 8 7 6 5 

	SeqListPopFront(&st);
	SeqListPopFront(&st);
	SeqListPopFront(&st);
	SeqListPopFront(&st);
	SeqListPrint(&st);
	//5 

	SeqListPopFront(&st);
	SeqListPrint(&st);
	//NULL

	SeqListDestroy(&st);
}

void test2()
{
	SeqList st;
	SeqListInit(&st);
	SeqListPushBack(&st, 1);
	SeqListPushBack(&st, 2);
	SeqListPushBack(&st, 3);
	SeqListPushBack(&st, 4);
	SeqListPrint(&st);
	//1 2 3 4 

	int pos1=SeqListFind(&st, 4);
	SeqListInsert(&st,pos1, 99);
	SeqListPrint(&st);
	//1 2 3 99 4 

    int pos2 = SeqListFind(&st, 100);
	SeqListInsert(&st, pos2, 99);

	int pos3 = SeqListFind(&st, 2);
	SeqListErase(&st, pos3);
	SeqListPrint(&st);
	//1 3 99 4 


	SeqListDestroy(&st);
}

int main()
{
	//test1();

	test2();
	return 0;
}